﻿using Common.Contract.Authentication.Record;
using Common.Util.Validation;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Authentication.Model.ViewModel.Account
{
    public class UserViewModel : GenerateViewMode, IViewModel
    {
        [Display(Name = "Active:")]
        public bool Active { get; set; }

        [Required(ErrorMessage = "User name is required.")]
        [Display(Name = "User name:")]
        public string UserName { get; set; }

        [Required(ErrorMessage = "Email is required.")]
        [RegularExpression(RegexValidation.Email, ErrorMessage = "Email is invalidate")]
        [Display(Name = "Email:")]
        public string Email { get; set; }

        [Required(ErrorMessage = "First name is required.")]
        [Display(Name = "First name:")]
        public string FirstName { get; set; }

        [Display(Name = "Last name:")]
        public string LastName { get; set; }

        [Display(Name = "Mobile:")]
        [RegularExpression(RegexValidation.Phone, ErrorMessage = "Phone number is invalidate")]
        public string Mobile { get; set; }

        [Display(Name = "Profile image:")]
        public string ImageUrl { get; set; }


        public List<GroupRecord> Groups { get; set; }

        [Display(Name = "Group:")]
        [Required(ErrorMessage = "Group is required.")]
        public string GroupIdentifier { get; set; }
    }
}
